From: Marina Zhurakhinskaya Date: Sun, 6 Mar 2011 21:29:11 +0000 (-0500) Subject: Fix removing summary items X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8767 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4282748483d2a74fbad90dbe15035224531a6577;p=gnome-shell.git Fix removing summary items Unset this._expandedSummaryItem if it is the summary item that is being removed. This avoids "this._sourceTitle.clutter_text is null" error. Destroy the summary item actor only after calling _unsetClickedSummaryItem() that disconnects from one of its signals. https://bugzilla.gnome.org/show_bug.cgi?id=644043 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 5c4445810..d15bd62ce 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -1157,7 +1157,7 @@ MessageTray.prototype = { if (index == -1) return; - this._summaryItems[index].actor.destroy(); + let summaryItemToRemove = this._summaryItems[index]; let newSummaryItemsIndex = this._newSummaryItems.indexOf(this._summaryItems[index]); if (newSummaryItemsIndex != -1) @@ -1168,6 +1168,9 @@ MessageTray.prototype = { if (source.isChat) this._chatSummaryItemsCount--; + if (this._expandedSummaryItem == summaryItemToRemove) + this._expandedSummaryItem = null; + if (this._longestSummaryItem.source == source) { let newTitleWidth = 0; this._longestSummaryItem = null; @@ -1192,11 +1195,13 @@ MessageTray.prototype = { this._notificationRemoved = true; needUpdate = true; } - if (this._clickedSummaryItem && this._clickedSummaryItem.source == source) { + if (this._clickedSummaryItem == summaryItemToRemove) { this._unsetClickedSummaryItem(); needUpdate = true; } + summaryItemToRemove.actor.destroy(); + if (needUpdate); this._updateState();